package com.ajs.multipledatasources.service;

import com.ajs.multipledatasources.dao.TeacherDao;
import com.ajs.multipledatasources.datasource.DS;
import com.ajs.multipledatasources.datasource.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ajs.multipledatasources.entity.Teacher;

@Service
public class TeacherService {
	@Autowired
	private TeacherDao ts2;

	@Transactional
	@DS(DataSourceType.DataBaseType.TEST02)
	public void addTeacher(Teacher t) {
		ts2.save(t);
	}

}
